-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cli version
: Show date as part of the version next to the commit id, shorten commit id
#2034
base: main
Are you sure you want to change the base?
Conversation
We discussed the Nix part with @Ralith. He suggested preConfigure = ''
NIX_JJ_GIT_HASH=$(git <something> --git-dir=${./.}/jj/repo/store/git)
''; I might look into that, or I could leave it for some more Nix person to do. |
Something like this should work, I think, in
|
Commit cf39ada on branch
The first is a clean commit and the second is dirty. This uses the
Which isn't useful, but mostly only happens to us during development, so I think it's OK. If you can unify these two version paths to be the same, that would be great. Feel free to mold this commit to your needs. |
Won't this be different than the commit date? |
|
The point of I now realised that a better approach would probably be to set |
@thoughtpolice Thanks! I don't feel like adding that to this PR right now, but it looks like it'd be easy to add. Either the PR can wait or it can go into a separate one. I think adding "-dirty" should be a separate change, as it'd require adjusting a test, and ideally it'd go together with supporting it in the regular Rust code.
This sounds fine to me, but I don't grok Nix philosophy or implementation enough to really know whether this is a good idea. I think it should be a separate discussion/PR in any case. |
Also, I'll leave it up to (the plural) you to decide which Nix expression for the date is exactly right. It would be nice to be consistent, but we can always fix it later. |
7c5ab8e
to
383ab92
Compare
I changed the date format to YYYYMMDD and incorporated some of @thoughtpolice's changes. Thank you, they were very helpful! I rewrote them a bit and removed the portion having to do with dirty revisions for now. We should add it back when the rest of |
ed4087c
to
934caa2
Compare
There's a mild inconsistency in dates. I'm guessing one is in UTC and one is in the local timezone. I think that's fine, resolution of plus/minus a day should be enough here. However, if somebody wants to ensure UTC everywhere it'd certainly be nicer! The UTC timestamp feature suggested in https://discord.com/channels/968932220549103686/969829516539228222/1139656152926404649 would be helpful here. |
FWIW, if you can set
|
Thanks, that sounds good. I don't think I'll use it in this commit, though. It's blocked on the jj side by #2080, I think. |
635b24c
to
136a89b
Compare
5d2f17b
to
f2f51c4
Compare
9787a13
to
c3a07de
Compare
2bed6cf
to
a5d36f9
Compare
f41cdaa
to
94ad7b5
Compare
7df5e36
to
dd1af70
Compare
db5e582
to
fa228d5
Compare
The date comes from the commiter date of the commit. This is so that it's easy to tell at a glance how old a version is. To make it easier to get UTC date, we first obtain it as a Unix timestamp, which should always be UTC. This will make the interaction with Nix in a subsequent commit easier.
16 characters ought to be enough for anyone :)
Thanks to @thoughtpolice for providing the original version of the nix code; I edited it a bit.
Replace `jj 0.10.0-20231027-bb8af5adc4f98ff2` with `jj 0.10.0+20231027-bb8af5adc4f98ff2`. According to https://semver.org, the build metadata should be separated by a `+`, not `-`. If semver rules are pedantically followed, `jj 0.10.0-20231027-bb8af5adc4f98ff2` sorts before `jj 0.10.0`, whereas the build metadata is ignored for the purposes of ordering. I'm not sure whether anybody else is likely to treat the full `jj version` string as a semver this pendantically, but we can :). I discovered this when thinking about jj-vcs#2258; see that PR for a few more details about pedantic semvers.
Checklist
If applicable:
CHANGELOG.md